<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="/WEB-INF/view/include/inc.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
 	<%@ include file="/WEB-INF/view/jQgrid.jsp"%>
</head>
<body>
<div class="container-fluid" id="main-container">
    <div id="page-content" class="clearfix">
        <div class="row-fluid">
            <div class="row-fluid">
                <!-- 检索  -->
                <div class="ibox-title" style="border-color: white;">
                    <div class="row">
		                 <div class="col-sm-12">
							<div class="form-group form-inline">
								<span>姓名：</span>
								<select id="createUserId" class="form-control">
								<option value="">==请选择==</option>
								<c:forEach var="user"  items="${users }">
								<option value="${user.id }">${user.dep.depName} -/- ${user.truename }</option>
								</c:forEach>
								</select>
								<%-- <span>按时间段查询：</span>
								<input id="startDate" type="text" placeholder="请输入开始时间" class="input-sm form-control datetime">--
								<input id="endDate" type="text" placeholder="请输入结束时间" class="input-sm form-control datetime"> --%>
								<span>按时间查询：</span>
								<select id="queryDate" class="form-control " onchange="query_date(this.options[this.options.selectedIndex].value)">
								   <option value="">==请选择==</option>
								   <option value="year">本年度</option>
								   <option value="helf">半年</option>
								   <option value="quarter">本季度</option>
								   <option value="month">本月</option>
								   <option value="week">本周</option>
								</select>
								<span>按具体时间段查询：</span>
								<input id="startDate" type="text" placeholder="请选择开始日期" class="input-sm form-control datetime"  readonly="readonly" >--
								<input id="endDate" type="text" placeholder="请选择结束日期" class="input-sm form-control datetime"  readonly="readonly" >
								<a id="find_btn" type="button"
												class="btn btn-sm btn-primary"> 搜索</a>&nbsp;&nbsp;
								<a id="reset_btn" type="button"
												class="btn btn-sm btn-warning"> 重置</a>&nbsp;&nbsp;
							</div>
						</div>
                    </div>
                </div>
                <!-- biaogebigin -->
                <div class="ibox-content" style=" padding-left: 0px; margin-top: 10px;">
                    <div class="jqGrid_wrapper">
                        <table id="table_list"></table>
                        <div id="pager_list"></div>
                    </div>
                </div>
                <!-- tableover -->
            </div>
            <!-- PAGE CONTENT ENDS HERE -->

        </div>
        <!--/row-->
    </div>
    <!--/#page-content-->
</div>
<!--/.fluid-container#main-container-->
<script type="text/javascript">
    $(top.hangge());
    $(".datetime").datetimepicker({
    	  minView: "month",//设置只显示到月份
    	  format : "yyyy-mm-dd",//日期格式
    	  autoclose:true,//选中关闭
    	  todayBtn: true,//今日按钮
          language:  'zh-CN',
    });
        $.jgrid.defaults.styleUI = "Bootstrap";
        $("#table_list").jqGrid({
            url: '<%=contextPath%>/report/getTeam',
            datatype: "json",
            postData: {}, //发送数据
            autowidth: true,
            rownumbers: true,
            rowNum:-1,
            shrinkToFit: true,
            mtype: "post",
            colNames: ["id","顾问姓名","上传list数","录入简历数","联系人数","推荐人数","初试人数","复试人数","终试人数","offer数","offer金额","已过保障期","未过保障期","已收款","未收款"],
            colModel: [{
                name: "id",
                index: "id",
                hidden: true
            }, {
                name: "name",
                index: "name",
                width: 80
            }, {
                name: "listCount",
                index: "listCount",
                width: 80
            }, {
                name: "createCount",
                index: "createCount",
                width: 80
            }, {
                name: "contactCount",
                index: "contactCount",
                width: 80
            }, {
                name: "recommendCount",
                index: "recommendCount",
                width: 80
            }, {
                name: "firstCount",
                index: "firstCount",
                width: 80
            }, {
                name: "secondCount",
                index: "secondCount",
                width: 80
            }, {
                name: "thirdCount",
                index: "thirdCount",
                width: 80
            }, {
                name: "offerCount",
                index: "offerCount",
                width: 80
            }, {
                name: "offerMoney",
                index: "offerMoney",
                width: 80
            }, {
                name: "passCount",
                index: "passCount",
                width: 80
            }, {
                name: "noPassCount",
                index: "noPassCount",
                width: 80
            }, {
                name: "moneyReceipt",
                index: "moneyReceipt",
                width: 80
            }, {
                name: "uncollect",
                index: "uncollect",
                width: 80
            }],
            height: $(window).height() - 170,
            //pager: "#pager_list",
            //multiselect: true,//多选按钮
            //multiboxonly: true,
            viewrecords: true,
            hidegrid: false
        });
        //表格自适应高宽
        $(window).bind("resize", function () {
            var b = $(".jqGrid_wrapper").width();
            $("#table_list").setGridWidth(b);
            $("#table_list").setGridHeight($(window).height() - 170);
        })
        //$("#table_list").navGrid('#pager_list', {edit: false, add: false, del: false, search: false})
        /* 判断是否有添加权限 */
        //检索
        $("#find_btn").click(function () {
        	var createUserId = $("#createUserId").val();
        	var queryDate = $("#queryDate").val();
            //开始时间
        	var startDate = $("#startDate").val();
            //结束时间
            var endDate = $("#endDate").val();
            $("#table_list").jqGrid('setGridParam', {
                postData: {
                	'createuserid':createUserId,
                	'type':queryDate,
                	'startDate': startDate,
                	'endDate':endDate
                	}//发送数据
            }).trigger("reloadGrid"); //重新载入
        });
        $("#reset_btn").click(function(){ 
        	$('#createUserId').val('');
			$('#queryDate').val('');
			$("#startDate").val('');
			$("#endDate").val('');
		});
</script>
</body>
</html>

